# # -*- coding: utf-8 -*-
# # created by Src - 一路好时光
# import requests
# import json
# import time
#
# users = ["1482551165"]
#
# contents = [
#     "hey 老弟，来看下我的课呀......",
#     "test http://baidu.com 这里有你想要的一切"
# ]
#
# sender_id =1482551165
# dev_id = "97843768-6137-4195-B9AD-1353CD922A57"
# csrf_token = "8e45ab6d713fc3296f8da8f928e5f415"
#
# def bulk_msg(cookies):
#     for user in users:
#         receiver_id = user
#         resp1 = requests.post(
#             url="https://api.vc.bilibili.com/web_im/v1/web_im/send_msg",
#             headers={
#                 'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36',
#                 'Referer': 'https://message/bilibili.com/',
#                 'Origin':'https://message/bilibili.com/',
#                 'Host':'api.vc.bilibili.com'
#             },
#             cookies=cookies,
#             data={
#                 "build":"0",
#                 "mobi_app": "web",
#                 "csrf_token": csrf_token,
#                 "msg[sender_uid]": sender_id,
#                 "msg[receiver_id]": receiver_id,
#                 "msg[receiver_type]": 1,
#                 "msg[msg_type]": 1,
#                 "msg[msg_status]": 0,
#                 "msg[content]": json.dumps({"contents":"\n".join(contents)}),
#                 "msg[timestamp]": int(time.time()),
#                 "msg[dev_id]": dev_id
#             }
#         )
#         print(resp1.text)
#         print(f"发送成功...{user}")
#
#
# if __name__ == '__main__':
#     bulk_msg(
#         {'INTVER':'1','bili_jct':'8e45ab6d713fc3296f8da8f928e5f415','SESSDATA':'8e2b6708%2C1737711505%2C9deb6%2A72CjCqUwRLoPJ4QOxVIH0fQP_nd4Ml5tRFDZa1WciiEVD5TzH7Chrgrf7_kRBvr21Q4fcSVkxUZXpBelpOM2hDUFd4RnNFbjBwZHVLOW93RGxLbFd3MEFHQTFTVE1pU01vdHFLQnBwQ2hiSU4yVWxpUEMxNjRWaWl2M04xWVVQbk4zM09kZExYTWtRIIEC'}
#     )